﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <div id="js-console"></div>
    <script src="../scripts/js-console.js"></script>\
    <script>

        function Solve(params) {
            var N = parseInt(params[0]);
            var answer = 0;

            answer++;

            for (var i = 2; i <= N; i++) {
                var previous = parseInt(params[i - 1]);
                var following = parseInt(params[i]);

                if (previous > following) {
                    answer++;
                }
            }

            return answer;
        }


        jsConsole.writeLine(Solve(["9", "1", "8", "8", "7", "6", "5", "7", "7", "6"]));
    </script>
</body>
</html>
